from examination.examiner import Examiner
from examination.pojo.test_paper import TestPaper
from examination.pojo.topic import Topic

def test():
    testPaper = TestPaper()
    # 创建一些测试数据
    testPaper.topic_list = [
        Topic(
            topic_id=1,
            topic_type="code",
            topic_num=1,
            topic_context="请实现一个函数，输入一个字符串，输出该字符串反转后的字符串。",
            topic_answer="def reverse_string(s):\n    return s[::-1]",
            topic_score=100,
        ),
    ]
    # 创建一个试卷
    test_paper = TestPaper()
    # 创建一些测试数据
    test_paper.topic_list = [
        Topic(
            topic_id=1,
            topic_type="code",
            topic_num=1,
            topic_context="请实现一个函数，输入一个字符串，输出该字符串反转后的字符串。",
            topic_answer="def reverse_string(s):\n    return s[::-1]",
            topic_score=100,
        ),
    ]
    examiner = Examiner()
    examiner.scoring(test_paper, testPaper)

if __name__ == "__main__":
    test()